#pragma once

#include <sys/syscall.h>

#define CALL_ARRAY_SIZE 512
// TODO: 参考新版 host OJ 修改下
//  用 -1 表示末尾
const int SYSCALL_WHITELIST[][CALL_ARRAY_SIZE] = {
    {-1},
    // C++
    {0,
     1,
     2,
     3,
     4,
     5,
     8,
     9,
     11,
     12,
     20,
     21,
     59,
     63,
     89,
     99,
     158,
     202,
     231,
     240,
     272,
     273,
     275,
     511,
     SYS_time,
     SYS_read,
     SYS_uname,
     SYS_write,
     SYS_open,
     SYS_close,
     SYS_execve,
     SYS_access,
     SYS_brk,
     SYS_munmap,
     SYS_mprotect,
     SYS_mmap,
     SYS_fstat,
     SYS_set_thread_area,
     252,
     SYS_arch_prctl,
     -1},
    // JAVA
    {0,
     1,
     2,
     3,
     4,
     5,
     9,
     10,
     11,
     12,
     13,
     14,
     21,
     56,
     59,
     89,
     97,
     104,
     157,
     158,
     202,
     218,
     231,
     273,
     257,
     61,
     22,
     6,
     33,
     8,
     13,
     16,
     111,
     110,
     39,
     79,
     302,
     SYS_socket, // 不对吧？为什么连 socket 这种网路接口都会用到？
     SYS_clock_getres,
     SYS_sched_getaffinity,
     SYS_sysinfo,
     SYS_pread64,
     SYS_fcntl,
     SYS_getdents64,
     SYS_getrlimit,
     SYS_rt_sigprocmask,
     SYS_futex,
     SYS_read,
     SYS_mmap,
     SYS_stat,
     SYS_open,
     SYS_close,
     SYS_execve,
     SYS_access,
     SYS_brk,
     SYS_readlink,
     SYS_munmap,
     SYS_close,
     SYS_uname,
     SYS_clone,
     SYS_uname,
     SYS_mprotect,
     SYS_rt_sigaction,
     SYS_getrlimit,
     SYS_fstat,
     SYS_getuid,
     SYS_getgid,
     SYS_geteuid,
     SYS_getegid,
     SYS_set_thread_area,
     SYS_set_tid_address,
     SYS_set_robust_list,
     SYS_exit_group,
     158,
     -1},
    // PYTHON
    {0,
     2,
     3,
     4,
     5,
     6,
     8,
     9,
     10,
     11,
     12,
     13,
     14,
     16,
     21,
     32,
     59,
     72,
     78,
     79,
     89,
     97,
     99,
     102,
     104,
     107,
     108,
     131,
     158,
     218,
     228,
     231,
     272,
     273,
     318,
     39,
     99,
     302,
     99,
     32,
     72,
     131,
     1,
     202,
     257,
     41,
     42,
     146,
     SYS_mremap,
     158,
     117,
     60,
     39,
     102,
     191,
     SYS_pread64,
     SYS_access,
     SYS_arch_prctl,
     SYS_brk,
     SYS_close,
     SYS_execve,
     SYS_exit_group,
     SYS_fcntl,
     SYS_fstat,
     SYS_futex,
     SYS_getcwd,
     SYS_getdents,
     SYS_getegid,
     SYS_geteuid,
     SYS_getgid,
     SYS_getrlimit,
     SYS_getuid,
     SYS_ioctl,
     SYS_lseek,
     SYS_lstat,
     SYS_mmap,
     SYS_mprotect,
     SYS_munmap,
     SYS_open,
     SYS_read,
     SYS_readlink,
     SYS_rt_sigaction,
     SYS_rt_sigprocmask,
     SYS_set_robust_list,
     SYS_set_tid_address,
     SYS_stat,
     SYS_write,
     SYS_getdents64,
     -1},

};